package com.bw.wxy.mvp.view.user.adapter;

import com.bw.wxy.R;
import com.bw.wxy.mvp.model.entity.UserItemEntity;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

public class UserAdapter extends BaseQuickAdapter<UserItemEntity, BaseViewHolder> {
    public UserAdapter() {
        super(R.layout.item_user_bottom);
    }


    @Override
    protected void convert(BaseViewHolder helper, UserItemEntity item) {
        helper.setText(R.id.user_items_tv,item.name);
        helper.setImageResource(R.id.user_items_arrows,R.mipmap.icon_pn_arrows);
        if (item.name.equals("夜间模式")){
            if (item.selFlag){
                helper.setImageResource(R.id.user_items_arrows,R.mipmap.checkbox_on);
            }else {
                helper.setImageResource(R.id.user_items_arrows,R.mipmap.checkbox_off);
            }
        }
        helper.addOnClickListener(R.id.user_items_arrows);
        helper.addOnClickListener(R.id.user_items_tv);

    }
}

